#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=32201;
const int maxm=15001;
struct point
{
	int x,y;
}a[maxm];
struct node
{
	int left,right,val,tem;
};
node tree[maxn*4];
int ans[maxm];

bool cmp(point a,point b)
{
	if(a.x==b.x)return a.y<b.y;
	return a.x<b.x;
}

void build(int l,int r,int u)
{
	tree[u].left=l;
	tree[u].right=r;
	tree[u].val=tree[u].tem=0;
	if(l==r)return;
	int mid=(l+r)/2;
	build(l,mid,2*u);
	build(mid+1,r,2*u+1);
}
void update(int l,int r,int u)
{
	if(l<=tree[u].left&&tree[u].right<=r)
	{
		tree[u].val+=1;
		tree[u].tem+=1;
		return;
	}
	if(tree[u].tem)
	{
		tree[u*2].val+=tree[u].tem;
		tree[u*2+1].val+=tree[u].tem;
		tree[u*2].tem+=tree[u].tem;
		tree[u*2+1].tem+=tree[u].tem;
		tree[u].tem=0;
	}
	int mid=(tree[u].left+tree[u].right)/2;
	if(l<=mid)update(l,r,2*u);
	if(r>mid)update(l,r,2*u+1);
}

int query(int pos,int u)
{
	if(tree[u].left==tree[u].right)return tree[u].val;
	if(tree[u].tem)
	{
		tree[u*2].val+=tree[u].tem;
		tree[u*2+1].val+=tree[u].tem;
		tree[u*2].tem+=tree[u].tem;
		tree[u*2+1].tem+=tree[u].tem;
		tree[u].tem=0;
	}
	int mid=(tree[u].left+tree[u].right)/2;
	if(pos<=mid)return query(pos,u*2);
	else return query(pos,2*u+1);
}


int main()
{
	freopen("test.in","r",stdin);
	int n;
	scanf("%d",&n);
	int maxy=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&a[i].x,&a[i].y);
		maxy=maxy>a[i].y?maxy:a[i].y;
	}
	sort(a+1,a+n+1,cmp);
	build(0,maxn,1);
	memset(ans,0,sizeof(ans));
	for(int i=1;i<=n;i++)
	{
		ans[query(a[i].y,1)]++;
		update(a[i].y,maxn,1);
	}
	for(int i=0;i<=n-1;i++)
		printf("%d\n",ans[i]);
	return 0;
}



